package com.anycc.cloud.core.repository;

import com.anycc.cloud.core.entity.Org;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

/**
 * org repository
 */
public interface OrgRepository extends JpaRepository<Org, String>, JpaSpecificationExecutor<Org> {

    /**
     * find org by code
     *
     * @param code code
     * @return Org
     */
    Org findByCode(String code);

    /**
     * 统计类型Id为typeId的org数
     *
     * @param typeId typeId
     * @return Long
     */
    Long countByTypeId(String typeId);
}
